﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;


public partial class blog : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
		SelectMenuNode();
	}
	private void SelectMenuNode()
	{
		// Get the current page, the whole page, and nothing but the page.  Just the Fax, ma'am.
		string page = Request.RawUrl.Substring(Request.RawUrl.LastIndexOf('/') + 1);
		if (page.Contains('?')) page = page.Substring(0, page.IndexOf('?'));

		int index = 0;
		switch (page.ToLower())
		{
			case "blog.aspx":
			case "post.aspx":
			default:
				index = 0; break;
			case "archives.aspx":
				index = 1; break;
			case "categories.aspx":
				index = 2; break;
			case "tags.aspx":
				index = 3; break;
		}
		



		// Update styles appropriately
		tMenu2.Rows[0].Cells[index].Style.Add("border-bottom", "solid 1px #ffffff");
		tMenu2.Rows[0].Cells[index].Style.Add("border-top", "solid 3px #565656;");

	}
}
